﻿using System.Collections.Generic;

namespace ZGameFramework.Config
{
    public class CFG_NAME_DATA : ConfigCfgData
    {
        Dictionary<int, CFG_NAME> m_dictData = new Dictionary<int, CFG_NAME>(); 
        public string FILE_NAME = "CFG_NAME";
        public override bool Load()
        {
            return LoadCfg<CFG_NAME>(m_dictData, FILE_NAME);
        }

        public CFG_NAME this[int id]
        {
            get {
                return GetCfg( id );
            }
        }

        public CFG_NAME GetCfg(int id)
        {
            CFG_NAME cfg = null;
            if (m_dictData.TryGetValue(id, out cfg))
            {
                return cfg;
            }
            return null;
        }

        public Dictionary<int, CFG_NAME> Dict{ get => m_dictData;  }
    }
} 